<?php
/**
 * Created by PhpStorm.
 * User: 丶晓
 * Date: 2017/8/24
 * Time: 15:51
 */

namespace app\home\model;


use think\Db;
use think\Model;

class AccountModel extends Model
{
    // 查
    public function selectInfo($type, $miniID, $data = null)
    {
        if (empty($type) or empty($miniID)) {
            return false;
        }
        switch ($type) {
            case 'seleteWXOPEN_id': // need mini_id . 根据小程序主键查询appid
                return Db::table('wyz_miniapps')->where('id', $miniID)->value('AppId');
                break;
            case 'seleteWXOPEN_secret': // need mini_id . 根据小程序主键查询secret
                return Db::table('wyz_miniapps')->where('id', 'eq', $miniID)->value('AppSecret');
                break;
        }
        return false;
    }

}